<?php
$teamNameExists = 0;
$teamAdded = 0;

$realteam = new RealTeam("name");
if(isset($_POST['submit'])){
	$realteam = new RealTeam($_POST['teamname']);
	if(!$realteam->validationName()){
		$dbconnect = DBconnect::getInstance();
		if(!$dbconnect->isExistsTeamName($realteam)){
			$dbconnect->addRealTeam($realteam);
			$teamAdded = 1;
		}
		else {
			$teamNameExists = 1;
		}
	}
	if($teamAdded) echo $_POST['teamname']." added in database!";
}

?>